<!DOCTYPE html>

<html lang="en-US">
<@common.header/>

<body class="page-sub-page page-create-account page-account" id="page-top">
<!-- Wrapper -->
<div class="wrapper">
    <!-- Navigation -->
    <@common.nav/>
    <!-- end Navigation -->
    <!-- Page Content -->
    <div id="page-content">
        <!-- Breadcrumb -->
        <div class="container">
            <ol class="breadcrumb">
                <li><a href="#">主页</a></li>
                <li class="active">注册</li>
            </ol>
        </div>
        <!-- end Breadcrumb -->

        <div class="container">
            <header><h1>注册账号</h1></header>
            <div class="row">
                <div class="col-md-4 col-sm-6 col-md-offset-4 col-sm-offset-3">
                    <#--<h3>账户类型</h3>-->
                    <form role="form" id="form-create-account" method="post" enctype="multipart/form-data" action="/accounts/register" style="font-size: 20px;font-weight: 500">
                    <div class="radio" id="create-account-user">

                    <#-- <div class="radio" id="agent-switch" data-agent-state="">
                     <label>
                         <input type="radio" value="2" id="account-type-agent" name="type" required>经纪人
                     </label>
                 </div>
                 <div id="agency" class="disabled">
                     <div class="form-group">
                         <label for="account-agency">选择经纪机构:</label>
                         <select name="agencyId" id="account-agency">
                               <option value="0" >请选择经纪机构</option>
                              <#list agencyList as agency>
                                 <option value="${agency.id}" >${agency.name}</option>
                              </#list>
                         </select>
                     </div><!-- /.form-group &ndash;&gt;
                 </div>-->
                        <#--<hr>-->

                           <input type="text" value="1" id="account-type-user"  name="type"  hidden>
                           <input type="text" value="0" id="account-type-user"  name="agencyId"  hidden>
                            <input type="text" id="form-create-account-full-name" name="name" value="新用户" hidden>

                        <div class="form-group">
                            <label for="form-create-account-email"><font color="red" >*</font>手机号:</label>
                            <input type="text" class="form-control" placeholder="请输入手机号" id="phone"  name="phone" required>
                        </div>
                        <div class="form-group" style="margin-top: 15px;">
                            <label for="form-create-account-email"><font color="red">*</font>短信验证码:</label>
                                <div class="input-group">
                                    <input type="text" class="form-control" name="smscode" placeholder="请输入验证码"  required>
                                    <span class="input-group-btn">
                                        <a id="sendMsgBtn"   class="btn btn-default" type="button"  onclick="sendMsg();" >获取短信验证码</a>
                                      </span>
                                </div><!-- /input-group -->

                        </div>
                        <div class="form-group" style="margin-top: 15px;">
                            <label for="form-create-account-email"><font color="red">*</font>邮件:</label>
                            <input type="text" class="form-control" id="form-create-account-email"  name="email" placeholder="请输入邮件"  required>
                        </div><!-- /.form-group -->
                       <!-- /.form-group -->
                        <div class="form-group" style="margin-top: 15px;">
                            <label for="form-create-account-password"><font color="red">*</font>密码:</label>
                            <input type="password" class="form-control" id="form-create-account-password" name="passwd" placeholder="请输入密码"  required>
                        </div><!-- /.form-group -->
                        <div class="form-group" style="margin-top: 15px;">
                            <label for="form-create-account-confirm-password"><font color="red">*</font>确认密码:</label>
                            <input type="password" class="form-control" id="form-create-account-confirm-password" name="confirmPasswd" placeholder="请输入确认密码"  required>
                        </div><!-- /.form-group -->

                       <#-- <div class="form-group">
                            <label for="form-create-account-email"><font color="red">*</font>用户头像:</label>
                            <input id="file-upload" type="file" class="file" multiple="true" data-show-upload="false" data-show-caption="false" data-show-remove="false" accept="image/jpeg,image/png" data-browse-class="btn btn-default" data-browse-label="选择图片" name="avatarFile" required>
                            <figure class="note"><strong>注意:</strong> 只能上传.png,.jpg类型的图片</figure>
                        </div>-->
                              
                        
                        <div class="form-group clearfix">
                            <button type="submit" class="btn  btn-default" id="account-submit" style="margin-left: 120px;">注册账号</button>
                        </div><!-- /.form-group -->
                        
                        

                    </form>
                    <hr>
                    <div class="center">
                        <figure class="note"> 我已阅读并同意<a href="terms-conditions.html">用户协议</a></figure>
                    </div>
                </div>
            </div><!-- /.row -->
        </div><!-- /.container -->
    </div>
    <!-- end Page Content -->
    <!-- Page Footer -->
    <@common.footer/>
    <!-- end Page Footer -->
</div>

<@common.js/>
<!--[if gt IE 8]>
<script type="text/javascript" src="/static/assets/js/ie.js"></script>
<![endif]-->
 <script  type="text/javascript" >
     var count =60;
     var Icon;
     function sendMsg(){

         var phone = $("#phone").val();
         if(phone == null || phone ==""){
             errormsg("error","手机号不能为空");
         }else {
             // $.get("/accounts/sendRegistCode?phone=" + phone);
             successmsg("验证码", "验证码已发送注意查收");
             $("#sendMsgBtn").attr("disabled", "disabled");
             Icon = setInterval(showSecond,1000);

         }
     }

     function showSecond() {
        $("#sendMsgBtn").html(count);
        count--;
         if(count<0){
             window.clearInterval(Icon);
             $("#sendMsgBtn").attr("disabled",false);
             $("#sendMsgBtn").html("获取短信验证码");
             count =60;
         }
     }
    $(document).ready(function() {
          var errorMsg   = "${errorMsg!""}";
          var successMsg = "${successMsg!""}";
          if(errorMsg){ 
              errormsg("error",errorMsg);
          }
          if(successMsg) {
              successmsg("success",successMsg);
          }
        })
        
 </script>
</body>
</html>